//
//  MessangerSprite.h
//  MessangerSkeleton
//
//  Created by User-16 on 4/1/14.
//  Copyright (c) 2014 IOTrainingCamp. All rights reserved.
//

#import "CCSprite.h"
#import "cocos2d.h"
#import "cocos2d-ui.h"
#import "CCProtocols.h"
#import "Configuration.h"


@class CCTiledMap;

//need that for multiplayer
//Maybe we will have to implement a separate class for the enemy at a later point

//moved into Configuration.h
//typedef enum {
//    kMessengerSelf,
//    kMessengerEnemy
//} MessengerSpriteType;

struct Interval {
    CGPoint begining;
    CGPoint end;
} front, bottom, back, up;

typedef struct Interval Interval;
Interval MakeInterval(CGPoint begining, CGPoint end);


@interface MessengerSprite : CCSprite

@property (nonatomic,readonly) MessengerSpriteType characterType;

//current-game related properties
@property (readonly)int distance;
@property (nonatomic, readonly) CGFloat secondsPassedSinceStart;
@property CGPoint spawnPoint;

//state variables
@property (readonly)CharacterState state;
@property (nonatomic, readonly) NSUInteger powerUpSpeedBoostCollectedItemsCount;
@property CCNode* lastHitObstacle;
@property BOOL hitBottom;
@property (readonly) CGPoint currentSpeed;

//sprite box division
@property struct Interval front;
@property struct Interval bottom;
@property struct Interval back;
@property struct Interval up;


//designated initializer
- (id)initWithType:(MessengerSpriteType)type;

//behaviours
- (void)run;
- (void)jump;
- (void) slide;;
-(void) collectPowerUpSpeedBoostItem;
-(void) turboBoost;
//hit behaviours
-(void) hitToFrontOrBack;
-(void) hitToBottom;
-(void) endHitToBottom;
-(void) hitToTop;


@end
